<template>
  <section>
    <header>
      <h2>{{rowData.title}}</h2>
      <p>{{rowData.publish_time}}</p>
    </header>
    <div v-html="rowData.content">
    </div>
  </section>
</template>

<script>
import ajax from '@/util/request';

export default {
  props: {
    params: {
      type: Object,
      required: true
    }
  },
  data() {
    return {
      rowData: {}
    }
  },
  watch: {
    params: {
      immediate: true,
      handler(newVal) {
        if (!newVal) {
          return;
        }
        ajax("/content/queryRow",{t_content_pk: newVal.t_content_pk}).then(({data}) => {
          if (data.status > 0) {
            this.rowData = data.result_data;
          }
        })
      }
    }
  }
};
</script>

<style>
</style>